/*jslint browser: true, devel: true, bitwise: true, white: true, plusplus: true, nomen:true */
/*global $:true, define:true */

define(['WID/Test/TestCase','WID/Test/NeedHelper'], function(TestCase,NeedHelper) {
"use strict";
return {
	name:'TestCase', 
	desc:'Its testing testCase from Test Module',
  each: {
		testCase: null
  },
              
	beforeEach: function() {
		this.each.testCase = new TestCase();
	},
               
	tests:[
		function creating(each) {
			var tc = each.testCase;
			this.expect(tc.Data).toBeUndefined();
			this.expect(tc.after).toBeUndefined();
			this.expect(tc.before).toBeUndefined();
			this.expect(tc.TestMatcher).toBeDefined();
			this.expect(tc.CurrentExpect).toBe(-1);
			this.expect(tc.CurrentResults).toBeDefined(); 
			this.expect(tc.Reporter).toBeUndefined(); 
		},
		
		function setData(each) {
			var 
				tc = each.testCase,
				data = {name:'test',desc:'testDesc'},
				before = function() {},
				after = function() {};
			each = {test1:'test1'};
			tc.setData(data);
			this.expect(tc.Data).toBe(data);
			this.expect(tc.each).toBeUndefined();
			this.expect(tc.after).toBe(TestCase.EmptyCallback);
			this.expect(tc.before).toBe(tc.after);
			
			data.each = each;
			data.afterEach = after;
			data.beforeEach = before;
			tc.setData(data);
			this.expect(tc.each).toBe(each);
			this.expect(tc.after).toBe(after);
			this.expect(tc.before).toBe(before);
		},
		
		function describe(each) {
			var tc = each.testCase;
			tc.describe('test');
			this.expect(tc.CurrentResults.desc).toBe('test');	
		},
		
		function need(each) {
			var 
				tc = each.testCase,
				 needHelper = tc.need;
			this.expect(needHelper).toBe(NeedHelper);
		},
		
		function expect() {
			var 
				tc = this.each.testCase,
				matcher = tc.expect(1);
			this.expect(matcher).toBeDefined();
			this.expect(tc.CurrentExpect).toBe(0);
		}
	]
};
});
